﻿IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[esf_files].[P_MoveFileReferenceToSubCatalog]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [esf_files].P_MoveFileReferenceToSubCatalog
GO


CREATE PROCEDURE esf_files.P_MoveFileReferenceToSubCatalog
	@pMonitoredDirectorySubCategoryID INT,
	@pLastMoveToSubCategoryUserAlias VARCHAR (20),
	@pID INT
AS

	UPDATE	
		[esf_files].[FileReference] 
	SET
		MonitoredDirectorySubCategoryID = @pMonitoredDirectorySubCategoryID,
		LastMoveToSubCategoryUserAlias = @pLastMoveToSubCategoryUserAlias,
		LastMoveToSubCategoryDateTime = GETDATE ()
	WHERE
		ID = @pID